package com.runa.monitor.platinterface.backwork.impl;

import com.runa.monitor.platinterface.backwork.function.AbstractTaskFunction;
import com.runa.monitor.platinterface.backwork.function.TaskFunction;
import com.runa.monitor.platinterface.extend.equ.EquInstruct;
import com.runa.monitor.platinterface.extend.equ.EquInstructService;
import com.runa.monitor.platinterface.netservice.connect.commstatus.CommStatus;

/**
 * 2024/11/15 15:30
 * zhangYB
 */
public class EquInstructTaskFunction extends AbstractTaskFunction<EquInstruct, Object, Void> {

    private String netSerial;
    private Integer priority = 100;

    public EquInstructTaskFunction(String netSerial) {
        this.netSerial = netSerial;
    }

    public void setPriority(Integer priority) {
        if (null != priority) {
            this.priority = priority;
        }
    }

    @Override
    public void setStatus(EquInstruct unused) {

    }

    @Override
    public void doApply(CommStatus status, Object obj) {
        EquInstructService.finish(netSerial, status);
    }

    @Override
    public Void waitResult() {
        return null;
    }

    @Override
    public String getSerial() {
        return null;
    }

    @Override
    public int getPriority() {
        return priority;
    }


}
